package trunk.control;

import java.io.IOException;
import java.util.ArrayList;
import trunk.model.Cliente;
import trunk.model.conf.EmissorRTPAudio;
import trunk.model.conf.EmissorRTPVideo;
import trunk.model.conf.ReceptorRTPAudio;
import trunk.model.conf.ReceptorRTPVideo;

public class ConferenciaControlador {

	public ArrayList<Cliente> participantes;
	String portaAudioReceptor1 = "49000";
	String portaVideoReceptor1 = "49111";
	String portaAudioReceptor2 = "49222";
	String portaVideoReceptor2 = "49333";
	String portaAudioEmissor1  = "49444";
	String portaVideoEmissor1  = "49555";
	String portaAudioEmissor2  = "49666";
	String portaVideoEmissor2  = "49777";

	public void startConf(ArrayList<Cliente> participantes) throws IOException, ClassNotFoundException {
		this.participantes = participantes;

		for(Cliente participante:participantes){
			String ip = participante.getInetAddress().getHostAddress();
			
			//EmissorRTPAudio emissorAudio = new EmissorRTPAudio(ip, portaAudioEmissor1);
			//emissorAudio.start();
			EmissorRTPVideo emissorVideo = new EmissorRTPVideo(ip, portaVideoEmissor1);
			emissorVideo.start();

			//ReceptorRTPAudio receptorAudio = new ReceptorRTPAudio(ip, portaAudioReceptor1);
			//receptorAudio.start();
			ReceptorRTPVideo receptorVideo = new ReceptorRTPVideo(ip, portaVideoReceptor1);
			receptorVideo.start();
		}
	}
}//FIM DA CLASSE ChatControlador
